
package com.zjff.myshop.front.controller;


import com.zjff.myshop.front.pojo.vo.CategoryVO;

import com.zjff.myshop.front.service.CategoryService;
import com.zjff.myshop.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@Api(value = "v1", tags = "03.分类模块")
@RequestMapping("/app/v1/category")
public class CategoryController {
    private static final Logger logger = LoggerFactory.getLogger(CategoryController.class);
    @Resource
    private CategoryService categoryService;

    /**
     * 查询商品分类列表（全部）
     */
    @ApiOperation(value = "查询商品分类的全部数据", notes = "商品分类页面使用")
    @GetMapping("/list")
    public Result<List<CategoryVO>> list() {
        List<CategoryVO> categoryVOList = categoryService.selectVOList();
        return Result.ok(categoryVOList);
    }

}
